home *** CD-ROM | disk | FTP | other *** search
- Path: news.chattanooga.net!usenet
- From: "Eric W. Bradway" <ebradway@microsports.com>
- Newsgroups: comp.lang.c
- Subject: Re: Recursive function -> how do you exit one?
- Date: Tue, 30 Jan 1996 19:00:22 -0500
- Organization: Micro Sports, Inc.
- Message-ID: <310EB116.11E@microsports.com>
- References: <4eh1g8$aba@pulp.ucs.ualberta.ca> <4ejbf0INN2b3@keats.ugrad.cs.ubc.ca>
- NNTP-Posting-Host: 205.244.28.38
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b5 (Win95; I)
-
- Kazimir Kylheku wrote:
- >
- > In article <4eh1g8$aba@pulp.ucs.ualberta.ca>,
- > Jacob Bukczynski <jbukczyn@gpu.srv.ualberta.ca> wrote:
- > >I'm using a recursive function to search for files. I need
- > >it to quit when a user presses Esc.
- > >
- > >Using
- > >
- > >return;
- > >
- > >doesn't seem to work, the funtion runs again. ( I tested
- > >this by putting a printf statement in front of the return -
- > >it got printed over and over again. )
- > >
- > >Is there a special way of exiting a recursive function?
- >
- > The Elegant Way:
- > ----------------
-
- Not bad...
-
- > The Real Way:
- > -------------
-
- Ewwww...that's a GOTO!
-
- IMHO...rewrite the function so it's not recursive.
-
- -Eric
-